#12245
# 5
# 667
# 8
# import keyword
#
# if True:
#     print("hello world")
#     print("hello world")
# else:
#     print("hello world")
#     print("hello world")
#     print("hello world")
#     print(11111)
#     print(keyword.kwlist)2
# num=10
# print(type(num))
# num ="hello"
# print(type(num))
# year=int(input("year"))
#     print("您输入的数字是:",year)
#     str1='h'
#     str2='j'
#     str3='s'
#


# 定义购物小票数据
receipt_data = {
    "单号": "OH202301010001",
    "时间": "2023-01-01 08:56:15",
    "商品": [
        {"名称": "EC16GTF卡", "数量": 1, "单价": 40.00, "金额": 40.00},
        {"名称": "读卡器", "数量": 1, "单价": 50.00, "金额": 50.00},
        {"名称": "水彩笔", "数量": 1, "单价": 8.00, "金额": 8.00},
        {"名称": "同现2米", "数量": 1, "单价": 5.00, "金额": 5.00}
    ],
    "总数": 4,
    "总额": 103.00,
    "折后总额": 103.00,
    "实收": 103.00,
    "找零": 0.00,
    "收银": "管理员"
}
# 打印购物小票
print("=" * 40)
print("             购物小票")
print("=" * 40)
print(f"单号: {receipt_data['单号']}")
print(f"时间: {receipt_data['时间']}")
print("-" * 40)
print(f"{'名称':<10} {'数量':<4} {'单价':<6} {'金额':<8}")
print("-" * 40)
for item in receipt_data["商品"]:
    # 使用字符串左对齐格式化输出商品信息
    print(f"{item['名称']:<10} {item['数量']:<4} {item['单价']:<6.2f} {item['金额']:<8.2f}")
print("-" * 40)
print(f"总数: {receipt_data['总数']}")
print(f"总额: {receipt_data['总额']:.2f}")
print(f"折后总额: {receipt_data['折后总额']:.2f}")
print(f"实收: {receipt_data['实收']:.2f}")
print(f"找零: {receipt_data['找零']:.2f}")
print(f"收银: {receipt_data['收银']}")
print("=" * 40)
print("         感谢惠顾，欢迎下次光临！")
print("=" * 40)